enum PageState {
  loading,
  empty,
  error,
  success,
  networkError,
  permissionError,
}

extension PageStateX on PageState {
  bool get isLoading => this == PageState.loading;
  bool get isEmpty => this == PageState.empty;
  bool get isError => this == PageState.error;
  bool get isSuccess => this == PageState.success;
  bool get isNetworkError => this == PageState.networkError;
  bool get isPermissionError => this == PageState.permissionError;
  
  bool get hasError => isError || isNetworkError || isPermissionError;
}